<template>
    <h2>商家</h2>
    <DetailCom :merchants="merchants"/>
</template>

<script>
    import {Merchants} from '../api'
    import DetailCom from "../components/DetailCom.vue";

    export default {
        name: "MerchantsView",
        components: {DetailCom},
        data() {
            return {
                name: this.$route.query.query,
                merchants: []
            }
        },
        methods: {
            DetailJump(query) {
                this.$router.push(`/detail-view?query=${query}`)
            }
        },
        mounted() {
            Merchants(`/get-category?${this.name}`).then(response => {
                    this.merchants = response.data
                }
            )
        }

    }
</script>

<style scoped>

</style>